package com.jxtc.enterprise.hr.vo;


import com.jxtc.enterprise.hr.dto.OrderStatisticDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

@Schema(description = "HR 端订单管理页面订单列表项")
@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class HrOrderVO {
    @Schema(description = "日期", example = "2024-05-31")
    private String date;

    @Schema(description = "点餐份数", example = "10")
    private Integer orderCount;

    @Schema(description = "总金额，单位：元", example = "100")
    private Integer totalAmount;

    public HrOrderVO(OrderStatisticDTO dto) {
        this.date = dto.getOrderDate();
        this.orderCount = dto.getOrderCount();
        this.totalAmount = dto.getTotalAmount();
    }

    public Double getTotalAmount() {
        return totalAmount / 100.0;
    }
}
